package com.zahb.qadx.ui.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.zahb.qadx.R;
import com.zahb.qadx.model.VideoListBean;
import com.zahb.qadx.util.CompatHelper;
import com.zahb.qadx.util.ImageLoaderKt;

import org.jetbrains.annotations.NotNull;

/**
 * Created by Zdw on 2020/10/16 13:54
 * 精彩视频
 */
public class VideoListAdapter extends BaseQuickAdapter<VideoListBean, BaseViewHolder> {

    public VideoListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, VideoListBean videoListBean) {
        ImageLoaderKt.loadImageSameCorners(baseViewHolder.getView(R.id.iv_icon),
                videoListBean.getCovenImage(), 5f, R.drawable.icon_video);
        baseViewHolder.setText(R.id.tv_name, videoListBean.getName())
                .setText(R.id.tv_desc, CompatHelper.isEmpty(videoListBean.getShortIntroduce())
                        ? "该素材暂无简介" : videoListBean.getShortIntroduce());
    }
}
